//
// Created by wkm on 2024-03-31.
//

#include <cstdio>
#include <cstdarg>
#include <cerrno>

int sb_fprintf(FILE *fp, const char *fmt, ...) {
    va_list ap;
    va_start(ap, fmt);
    int ret = 0;
    do {
        errno = 0;
        ret = vfprintf(fp, fmt, ap);
    } while (errno == EINTR);
    return ret;
}